<?php
	$css_list[0]['url'] = './tpl/css/setting.css';
	$js_list[0] = './public/js/city.js';
?>
<!--{template inc/header_n}-->
<div id="body" class="fm960">
	<div class="piece1">
		<div class="piece1_hd"></div>
		<div class="piece1_bd clearfix">
			<div id="content" style="width:1180px;">
				<!--{template inc/settings/settings_menu}-->
				<div id="setting_box" class="fl">
					<div id="setting_form" class="setting_password">
					<!--
					    <h1>身份认证</h1>
						<form id="myform" action="{u settings/realname}" method="post">
							<!--{if !empty($msg1)}-->
							<div class="green_alert_l">{$msg1}</div>
							<!--{/if}-->
							<dl>
								<dd>证件照片：</dd>
								<dt>
								    {if !empty($personal['card_img'])}
								    <span class="card_img_show" id="card_img_show_p"><img src="{$personal['card_img']}" width="200"/>{if $personal['flag']!=2}<a class="uploadbak" href="javascript:upload('p');">点击上传</a>{/if}</span>
								    {else}
								    <span class="card_img_show" id="card_img_show_p">
								        <a href="javascript:upload('p');">点击上传</a>
								    </span>
								    {/if}
								</dt>
								<dd>证件类型：</dd>
								<dt>
									<select name="card_type"{if $personal['flag']==2} disabled{/if}>
									    <option value="1"{if $personal['card_type']==1} selected{/if}>身份证</option>
									</select>
								</dt>
								<dd>证件号码：</dd>
								<dt>
									<input name="card_num" class="gray_text" type="text" value="{$personal['card_num']}"{if $personal['flag']==2} readonly{/if}>
								</dt>
								{if $personal['flag']!=2}
								<dd>&nbsp;</dd>
								<dt>
									<input type="hidden" name="op" value="savepersonal" />
									<input class="green_button" type="submit" value="确定">
								</dt>
								{/if}
							</dl>
							<input type="hidden" name="uid" value="{$uid}" />
						</form>
					-->
						{if $_FANWE['user']['user_type'] == 1}
						<h1>商家认证</h1>
						<form id="myform2" action="{u settings/realname}" method="post">
							<!--{if !empty($msg2)}-->
							<div class="green_alert_l">{$msg2}{if $shop['is_pay']==1}<span style="color: red;margin-left: 5px;font-weight: bold;">V认证费用已缴！</span>{/if}</div>
							<!--{/if}-->
							<dl>
								<dd>商家类型：</dd>
								<dt>
									<select name="stype" onchange="showtypes(this.value)"{if $shop['flag']==2} disabled{/if}>
									    <option value="0"{if $shop['stype']==0} selected{/if}>公司</option>
									 <!--   <option value="1"{if $shop['stype']==1} selected{/if}>个体</option>-->
									</select>
								</dt>
								<dd id="at0_t"{if $shop['stype']==1} style="display:none;"{/if}>认证类型：</dd>
								<dt id="at0_c"{if $shop['stype']==1} style="display:none;"{/if}>
									<select id="auth_type0" name="auth_type0" onchange="showtip(0)"{if $shop['flag']==2} disabled{/if}>
									    <option value="0"{if $shop['auth_type']==0} selected{/if}>婚庆</option>
									    <option value="1"{if $shop['auth_type']==1} selected{/if}>婚纱照</option>
									    <option value="2"{if $shop['auth_type']==2} selected{/if}>婚纱租赁</option>
									    <option value="3"{if $shop['auth_type']==3} selected{/if}>婚宴酒店</option>
									 <!--    <option value="4"{if $shop['auth_type']==4} selected{/if}>类型五</option>
									    <option value="5"{if $shop['auth_type']==5} selected{/if}>类型六</option>
									    <option value="6"{if $shop['auth_type']==6} selected{/if}>类型七</option>
									    <option value="7"{if $shop['auth_type']==7} selected{/if}>类型八</option>-->
									</select>
									<span id="tip0"></span>
								</dt>
								<dd id="at1_t"{if $shop['stype']==0} style="display:none;"{/if}>认证类型：</dd>
								<dt id="at1_c"{if $shop['stype']==0} style="display:none;"{/if}>
									<select id="auth_type1" name="auth_type1" onchange="showtip(1)"{if $shop['flag']==2} disabled{/if}>

									    <option value="0"{if $shop['auth_type']==0} selected{/if}>婚礼主持人</option>
									    <option value="1"{if $shop['auth_type']==1} selected{/if}>化妆师</option>
									    <option value="2"{if $shop['auth_type']==2} selected{/if}>跟拍师</option>
									    <option value="3"{if $shop['auth_type']==3} selected{/if}>摄像师</option>
									  <!--   <option value="4"{if $shop['auth_type']==4} selected{/if}>类型五(个)</option>
									    <option value="5"{if $shop['auth_type']==5} selected{/if}>类型六(个)</option>
									    <option value="6"{if $shop['auth_type']==6} selected{/if}>类型七(个)</option>
									    <option value="7"{if $shop['auth_type']==7} selected{/if}>类型八(个)</option>-->
									</select>
									<span id="tip1"></span>
								</dt>
								<dd>营业执照：</dd>
								<dt>
								    {if !empty($shop['card_img'])}
								    <span class="card_img_show" id="card_img_show_s"><img src="{$shop['card_img']}" width="200"/>{if $shop['flag']!=2}<a class="uploadbak" href="javascript:upload('s');">点击上传</a>{/if}</span>
								    {else}
								    <span class="card_img_show" id="card_img_show_s">
								        <a href="javascript:upload('s');">点击上传</a>
								    </span>
								    {/if}
								</dt>
								<dd>商家名称：</dd>
								<dt>
									<input name="shopname" class="gray_text" type="text" value="{$shop['shopname']}"{if $shop['flag']==2} readonly{/if}>
								</dt>
								<dd>联系电话：</dd>
								<dt>
									<input name="tel" class="gray_text" type="text" value="{$shop['tel']}"{if $shop['flag']==2} readonly{/if}>
								</dt>
								<dd>法人或企业主：</dd>
								<dt>
									<input name="unionpay_name" class="gray_text" type="text" value="{$shop['unionpay_name']}"{if $shop['flag']==2} readonly{/if}>
								</dt>
								<dd>身份证号：</dd>
								<dt>
									<input name="unionpay_idcard" class="gray_text" type="text" value="{$shop['unionpay_idcard']}"{if $shop['flag']==2} readonly{/if}>
								</dt>
								<input type="hidden" id="v2input" name="v2" value="{if !empty($shop['shopname'])}{$shop['v2']}{else}3{/if}">
								<dd>V认证：</dd>
								<dt>
									<style>
									.vrz {width:100%;margin-top: 5px;}
									.vrz li {width: 32%;float: left;text-align: center;margin-right: 2px;border:1px solid gray;height: 180px;cursor: pointer;}
									.vrz .vtitle {height: 50px;margin-top: 4px;}
									.vrz .vdes {margin-top: 4px;color:gray;}
									.bzj li label {margin-left: 10px;}
									.vrz .curr {border:2px solid red;}
									</style>
									<script type="text/javascript">
									function initV(v) {
										if(v == 4 || v == 3) {
											$('#v3').addClass('curr');
											if(v == 4) {
												$('.v4').show();
											}
										} else {
											$('#v' + v).addClass('curr');
											$('.v4').hide();	
										}
									}

									function bindEvent() {
										$('.vrz li').click(function(evt) {
											{if !empty($shop['shopname'])}
											alert('V认证信息提交后不支持修改');
											{else}
											$('.vrz li').removeClass('curr');
											$(this).addClass('curr');
											if(this.id == 'v3') {
												$('.v4').show();
												$('#v2input').val(3);
											} else {
												$('.v4').hide();
												$('#v2input').val(this.id[1]);
											}
											{/if}
										});
									}

									$(document).ready(function() {
										var v = $('#v2input').val();
										initV(v);
										bindEvent();
									});
									</script>
									<h5>注：V认证一旦提交将不能再修改，请谨慎选择！</h5>
									<ul class="vrz">
										<li id="v3">
											<h5>V3</h5>
											<p class="vtitle" style="color:red;">开通婚礼树V3会员<br/>999元/年<br/></p>
											<p class="vdes" style="font-weight: bold;">获得差评缓冲权：新人修改评价的时间由7天增加到90天；商家表达次数由一次增加到三次</p>
										</li>
										<li id="v2">
											<h5>V2</h5>
											<p class="vtitle">开通建设银行资金监管<br/>180元/年</p>
											<p class="vdes">婚礼交易款由建设银行监管，给新人以资金安全性保障</p>
										</li>
										<li id="v1">
											<h5>V2</h5>
											<p class="vtitle">实名实地认证，免费</p>
											<p class="vdes">无建行资金监管，无购买链接，无法积累真实评价</p>
										</li>
									</ul>
								</dt>
								<dd class="v4">V4会员：</dd>
								<dt class="v4">
									<h5>缴纳婚礼树保证金的V3会员</h5>
									<p style="color:gray">定金到账时间由婚礼日前7天，调整为婚礼款项T+1到账；并享有V4和保证金标识；排序靠前。保证金90天一循环，即90天后返还商家；若商家还希望继续享有T+1到账，则可续签90天。</p>
									<div>
										<h5>保证金等级:</h5>
										<ul class="bzj">
											<li><input id="bzj0" type="radio" name="bzj" value="0"{if !empty($shop['shopname'])} disabled="disabled"{if $shop['bzj']==0} checked="checked"{/if}{/if} /><label for="bzj1">不交保证金</label></li>
											<li><input id="bzj1" type="radio" name="bzj" value="10000"{if !empty($shop['shopname'])} disabled="disabled"{if $shop['bzj']==10000} checked="checked"{/if}{else} checked="checked"{/if} /><label for="bzj1">10000元</label></li>
											<li><input id="bzj2" type="radio" name="bzj" value="20000"{if !empty($shop['shopname'])} disabled="disabled"{if $shop['bzj']==20000} checked="checked"{/if}{/if} /><label for="bzj2">20000元</label></li>
											<li><input id="bzj3" type="radio" name="bzj" value="30000"{if !empty($shop['shopname'])} disabled="disabled"{if $shop['bzj']==30000} checked="checked"{/if}{/if}  /><label for="bzj3">30000元</label></li>
											<li><input id="bzj4" type="radio" name="bzj" value="50000"{if !empty($shop['shopname'])} disabled="disabled"{if $shop['bzj']==50000} checked="checked"{/if}{/if} /><label for="bzj4">50000元</label></li>
											<li><input id="bzj5" type="radio" name="bzj" value="100000"{if !empty($shop['shopname'])} disabled="disabled"{if $shop['bzj']==100000} checked="checked"{/if}{/if} /><label for="bzj5">100000元</label></li>
										</ul>
									</div>
								</dt>
								<dd>商家地点：</dd>
								<dt class="location">
									<select id="province" name="province">
									</select>
									&nbsp;&nbsp;
									<select id="city" name="city">
									</select>
								</dt>
								<dd>详细地址：</dd>
								<dt class="location">
									<input name="unionpay_address" class="gray_text" type="text" value="{$shop['unionpay_address']}"{if $shop['flag']==2} readonly{/if}>
								</dt>
								<dd>商家位置：</dd>
								<dt class="unick" >
                                    <div id="map" style="width:100%;height: 300px;"></div>
								</dt>
								{if $shop['flag']!=2}
								<dd>&nbsp;</dd>
								<dt>
									<input type="hidden" name="op" value="saveshop" />
									<input class="green_button" type="submit" value="确定">
									<p style="margin-top:5px;"><input type="checkbox" id="accept" /><label for="accept" id="rule">同意<span style="cursor:pointer;color:blue">开店协议</span></label></p>
								</dt>
								{/if}
							</dl>
							<input type="hidden" name="uid" value="{$uid}" />
							<input type="hidden" id="lat" name="lat" value="0">
							<input type="hidden" id="lng" name="lng" value="0">
						</form>
						{/if}
					</div>
					
				</div>
			</div>
		</div>
		<div class="piece1_ft"></div>
	</div>
	
	<div class="huoguojun2" id="huoguojun"><a href="/list.php?action=robot"><img src="/public/v1/img/huoguojun.png"></a></div>
    <div class="i_notice2">
        <div class="j_title">公告栏</div>
        <div class="j_list">
            <ul>
             <li><a href="#"><span style="color:red;">婚礼款项建设银行冻结监管</span></a></li>
             <li><a href="#"><span style="color:red;">真实新人评价（新人凭婚宴发票进行评价）</span></a></li>
             <li><a href="#"><span style="color:red;">没有中间商赚差价</span></a></li>

            </ul>
        </div>
    </div>
</div>
<input type="file" name="card_img_p" id="card_img_p" style="display:none;"/>
<input type="file" name="card_img_s" id="card_img_s" style="display:none;"/>
<div id="rule_content" style="display: none;padding:5px;">
	<p>免责声明</p>
	<p>尊敬的商家：</p>
	<p>    您好，如果您已经准备完成全部资料，并准备提交申请，在您提交申请前，请务必仔细阅读如下全部声明事项：</p>
	
	<p>1. 线上二维码的综合费率为0.6%，T+1到账。除了通过婚礼树网站，APP端查询定单以外，V3以上商户可通过建设银行结算卡实时查询建行监管户里的余额。</p>
	
	<p>2. 您确认并知悉，您的申请需依次经过线上与线下两次审核，请您在线上审核通过后，不要操作上线，等待线下婚礼树合作方“中国银联经理”和“建设银行经理”到门店现场审核，经线下审核通过后方可操作上线。如其中任一项审核未通过或您提交了虚假资质或信息，则婚礼树有权对申请主体提供的资质和信息进行删除、屏蔽及操作下线等处理。</p>
	
	<p>3. 您承诺您申请主体为依据中国法律合法成立并有效存续的法人或其它商事主体，能够独立承担法律责任，并具备从事申请业务应具备的行政许可、合法授权或同意，及具有履行合作所需的一切权力、权利及能力。</p>
	
	<p>4. 您承诺所提供证照等资质和信息真实、合法、有效且不侵犯任何第三方合法权益。</p>
	
	<p>5. 您承诺提交审核的证照等资质和信息应符合国家法律、法规、规章的规定，申请主体未伪造、变造、冒用或盗用他人证照等资质，未侵犯他人拥有合法权益的信息等；如因申请主体提供的证照等资质或信息造成婚礼树用户及相关第三方损失或婚礼树损失或承担责任的，申请主体存在质量和安全问题，由此造成的婚礼树用户及相关第三方投诉、索赔、经济损失等相关后果均由申请主体予以承担。</p>
	
	<p>6. 您承诺提供的商号、商标、图片等均具有发布和使用的充分权利或授权，否则因申请主体原因造成婚礼树或第三方损失的，申请主体承担全部赔偿责任。如因申请主体原因造成婚礼树被第三方要求赔偿或发生纠纷、行政处罚、诉讼的，申请主体应向婚礼树全额赔偿损失，婚礼树亦有权对申请主体提供的的证照等资质和信息进行删除、屏蔽及操作下线等处理。</p>
	
	<p>    对于以上声明，您如果存在异议，请停止申请；如您继续填写并提交申请，则视为您理解上述声明，并确认遵守全部事项并在违反时承担责任。</p>
</div>
<!--{template inc/footer}-->
<script type="text/javascript" src="/public/js/jquery.ajaxfileupload.js"></script>
<!--<script type="text/javascript" charset="utf-8" src="/public/js/jquery.form.min.js"></script>-->
<script src="/public/v1/js/layer/layer.js"></script>
<script type="text/javascript">
jQuery(function($){
	$.Bind_City("#province","#city","{if empty($shop['province'])}{$_FANWE['user']['reside_province']}{else}{$shop['province']}{/if}","{if empty($shop['city'])}{$_FANWE['user']['reside_city']}{else}{$shop['city']}{/if}");
});

function upload(type) {
    $('#card_img_' + type).click();
}

$(document).ready(function() {
	$("#card_img_p").AjaxFileUpload({
	    action: "settings.php?action=realname&savepcardimg&uid={$uid}&t="+new Date(),
		onComplete: function(filename, response) {
		    $("#card_img_show_p").html('<img src="'+response.name + '?t='+new Date()+'" width="200"/>');
		}
	});
	
	$("#card_img_s").AjaxFileUpload({
	    action: "settings.php?action=realname&savescardimg&uid={$uid}&t="+new Date(),
		onComplete: function(filename, response) {
		    $("#card_img_show_s").html('<img src="'+response.name + '?t='+new Date()+'" width="200"/>');
		}
	});

{if !empty($shop['shopname']) && $shop['is_pay'] == 0}
	// 缴费检测
	jQuery.ajax({
		url: '/misc.php?action=realname_pay',
		method: 'get',
		dataType: 'json',
		success: function(data) {
			if(data.status == 0) {
				var qrcode = data.data.qrcode + '?t=' + new Date();
				layer.open({
					type: 1,
					title: false,
					closeBtn: 0,
					shadeClose: true,
					skin: 'yourclass',
					content: '<div><img src="'+qrcode+'" /></div><div><p style="text-align:center;color:blue;font-size:16px;">'+data.data.tip+'</p><h5 style="text-align:center;color:red;">请使用支付宝扫码支付</h5></div>'
				});

				check_order_status();
			}
		},
		error: function() {
			alert('系统繁忙请稍候再试');
		}
	});
{/if}
	$('#myform2').submit(function(){
		if($('#accept').attr('checked') != 'checked') {
			alert('必须同意开店协议才能申请认证');
			return false;
		}
		
		return true;
	});
});

function check_order_status() {
	setTimeout(function() {
		jQuery.ajax({
			url: '/misc.php?action=realname_check_orderstatus',
			method: 'get',
			dataType: 'json',
			success: function(data) {
				if(data.status == 0) {
					alert('支付成功');
					location.reload(true);
				} else {
					check_order_status();
				}
			},
			error: function() {
				check_order_status();
			}
		});
	}, 5000);
}

function showtypes(t) {
    var t1 = t == 0 ? 1 : 0;
    $('#at'+t1+'_t').hide();
    $('#at'+t1+'_c').hide();
    $('#at'+t+'_t').show();
    $('#at'+t+'_c').show();
    showtip(t);
}

var tips = {
    0 : ['tip1', 'tip2', 'tip3', 'tip4', 'tip5', 'tip6', 'tip7', 'tip8'],
    1 : ['tip11', 'tip22', 'tip33', 'tip44', 'tip55', 'tip66', 'tip77', 'tip88']
};
function showtip(i) {
    var m = $('#auth_type'+i).val();
    $('#tip'+i).html(tips[i][m]);
}
showtip({if $shop['stype']==1}1{else}0{/if});

$('#rule').click(function() {
	layer.open({
		type: 1,
		title: '开店协议',
		//closeBtn: 0,
		area: '500px',
		shadeClose: true,
		skin: 'yourclass',
		content: $('#rule_content')
	});
});

// 地图相关
function onUpdateLatlng(latLng) {
	lat = latLng.lat;
	lng = latLng.lng;
	$('#lat').val(lat);
	$('#lng').val(lng);
}

var mapId = 'map', lat = 30.51811, lng = 114.422545;
window.onQQMapLoad = function() {
	var center = new qq.maps.LatLng(lat, lng);
	var map = new qq.maps.Map(document.getElementById(mapId), {
		center: center,
		zoom: 13
	});

	var marker = new qq.maps.Marker({
		draggable: true,
		map: map,
		position:center
	});

	qq.maps.event.addListener(marker, 'dragend', function(event) {
		if(onUpdateLatlng) onUpdateLatlng(event.latLng);
	});

	qq.maps.event.addListener(map, 'click', function(event) {
		marker.setPosition(event.latLng);
		if(onUpdateLatlng) onUpdateLatlng(event.latLng);
	});
}

// 地图相关
function onUpdateLatlng(latLng) {
	lat = latLng.lat;
	lng = latLng.lng;
	$('#lat').val(lat);
	$('#lng').val(lng);
}

var mapId = 'map', lat = 30.51811, lng = 114.422545;
window.onQQMapLoad = function() {
	var center = new qq.maps.LatLng(lat, lng);
	var map = new qq.maps.Map(document.getElementById(mapId), {
		center: center,
		zoom: 13
	});

	var marker = new qq.maps.Marker({
		draggable: true,
		map: map,
		position:center
	});

	qq.maps.event.addListener(marker, 'dragend', function(event) {
		if(onUpdateLatlng) onUpdateLatlng(event.latLng);
	});

	qq.maps.event.addListener(map, 'click', function(event) {
		marker.setPosition(event.latLng);
		if(onUpdateLatlng) onUpdateLatlng(event.latLng);
	});
}

window.qq = window.qq || {};
qq.maps = qq.maps || {};
window.soso || (window.soso = qq);
soso.maps || (soso.maps = qq.maps);
function getScript(src) {
	var protocol = (window.location.protocol == "https:") ? "https://" : "http://";
	src = src && (src.indexOf("http://") === 0 || src.indexOf("https://") === 0) ? src : protocol + src;

	var script = document.createElement("script");
	script.type = "text/javascript";
	script.onload= function() {
		if(window.onQQMapLoad) window.onQQMapLoad();
	};
	document.getElementsByTagName("head")[0].appendChild(script);
	script.src = src;
}
qq.maps.__load = function (apiLoad) {
	delete qq.maps.__load;
	apiLoad([["2.4.53","",0],["open.map.qq.com/","apifiles/2/4/53/mods/","open.map.qq.com/apifiles/2/4/53/theme/",true],[1,18,34.519469,104.461761,4],[1490429719879,"pr.map.qq.com/pingd","pr.map.qq.com/pingd"],["apis.map.qq.com/jsapi","apikey.map.qq.com/mkey/index.php/mkey/check","sv.map.qq.com/xf","sv.map.qq.com/boundinfo","sv.map.qq.com/rarp","apis.map.qq.com/api/proxy/search","apis.map.qq.com/api/proxy/routes/","confinfo.map.qq.com/confinfo"],[[null,["rt0.map.gtimg.com/tile","rt1.map.gtimg.com/tile","rt2.map.gtimg.com/tile","rt3.map.gtimg.com/tile"],"png",[256,256],1,19,"114",true,false],[null,["m0.map.gtimg.com/hwap","m1.map.gtimg.com/hwap","m2.map.gtimg.com/hwap","m3.map.gtimg.com/hwap"],"png",[128,128],4,18,"110",false,false],[null,["p0.map.gtimg.com/sateTiles","p1.map.gtimg.com/sateTiles","p2.map.gtimg.com/sateTiles","p3.map.gtimg.com/sateTiles"],"jpg",[256,256],1,19,"101",false,false],[null,["rt0.map.gtimg.com/tile","rt1.map.gtimg.com/tile","rt2.map.gtimg.com/tile","rt3.map.gtimg.com/tile"],"png",[256,256],1,19,"",false,false],[null,["sv0.map.qq.com/hlrender/","sv1.map.qq.com/hlrender/","sv2.map.qq.com/hlrender/","sv3.map.qq.com/hlrender/"],"png",[256,256],1,19,"",false,false],[null,["rtt2.map.qq.com/rtt/","rtt2a.map.qq.com/rtt/","rtt2b.map.qq.com/rtt/","rtt2c.map.qq.com/rtt/"],"png",[256,256],1,19,"",false,false],null,[["rt0.map.gtimg.com/vector/","rt1.map.gtimg.com/vector/","rt2.map.gtimg.com/vector/","rt3.map.gtimg.com/vector/"],[256,256],4,18,"114",["rt0.map.gtimg.com/icons/","rt1.map.gtimg.com/icons/","rt2.map.gtimg.com/icons/","rt3.map.gtimg.com/icons/"]],null],["s.map.qq.com/TPano/v1.1.2/TPano.js","map.qq.com/",""]],loadScriptTime);
};
var loadScriptTime = (new Date).getTime();
getScript("open.map.qq.com/apifiles/2/4/53/main.js");
</script>